using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.IO;

namespace TermPreprocessor
{
    public class StopWords
    {
        private StreamReader dictionaryReader;
        private Hashtable stopWords;
        public StopWords(String path)
        {
            dictionaryReader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read));
            stopWords = new Hashtable();
            string line;
            while ((line = dictionaryReader.ReadLine()) != null)
            {
                if (line[0] == '#')
                    continue;
                stopWords.Add(line, 1);
            }
           // foreach (string s in stopWords.Keys)
             //   Console.WriteLine(s);
        }

        public bool IsStopWord(String word)
        {
            return stopWords.ContainsKey(word);
        }
    }
}
